<?php
class PNAjaxHouseNoArray extends PNObjectExArray {
  function PNAjaxHouseNoArray($init=null, $where='')
  {
    $this->PNObject();

    $this->_objType       = 'votedata_house_no';
    $this->_objField      = 'id';
    $this->_objPath       = 'form';

    $this->_init($init, $where);
  }

  function genSort(){
    return " ORDER BY hou_no ASC";
  }

  function genFilter(){
    $pro_id  = FormUtil::getPassedValue ('pro_id', false);
    $dis_id  = FormUtil::getPassedValue ('dis_id', false);
    $tam_id  = FormUtil::getPassedValue ('tam_id', false);
    $vil_id  = FormUtil::getPassedValue ('vil_id', false);

    $wheres = array();
    if ($pro_id && intval($pro_id)) $wheres[] = " hou_pro_id = ".$pro_id;
    if ($dis_id && intval($dis_id)) $wheres[] = " hou_dis_id = ".$dis_id;
    if ($tam_id && intval($tam_id)) $wheres[] = " hou_tam_id = ".$tam_id;
    if ($vil_id && intval($vil_id)) $wheres[] = " hou_vil_id = ".$vil_id;

    return implode(' AND ', $wheres) ;
  }
}
